package org.jeecg.modules.category.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.category.entity.AoCategory;
import org.jeecg.modules.category.model.TreeSelectModel;

import java.util.List;
import java.util.Map;

/**
 * 题库分类
 *
 * @author thankgod7
 */
@SuppressWarnings("unused")
public interface AoCategoryMapper extends BaseMapper<AoCategory> {

    /**
     * 根据父级ID查询树节点数据
     *
     * @param query map
     * @param pid   pid
     * @return data
     */
    List<TreeSelectModel> queryListByPid(@Param("pid") String pid, @Param("query") Map<String, String> query);

    /**
     * 通过编码查询ID
     *
     * @param code code
     * @return data
     */
    @Select("SELECT ID FROM sys_category WHERE CODE = #{code,jdbcType=VARCHAR}")
    String queryIdByCode(@Param("code") String code);


}
